#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/ioctl.h>

#define HELLO_MAGIC 'k'
#define HELLO_CMD1    _IO(HELLO_MAGIC,0x1a)
#define HELLO_CMD2    _IO(HELLO_MAGIC,0x1b)

#define device_name "/dev/hellow"

int main(void)
{
	int ioctl_rdata;
	int fd,ret;

	fd = open(device_name, O_RDWR);
	if(fd == -1){
		perror("open");
		exit(0);
	}
	ret = ioctl( fd, HELLO_CMD2,&ioctl_rdata);
	
	if(ret == -1)
	{
		perror("ioctl");
		exit(0);
    	}
    printf("ioctl_rdata= %d \n",ioctl_rdata);

    close(fd);
    return 0;
}
